@import './theme/constants';
@import './theme/theme-black';
@import './theme/theme-white';

@import '~@/app/variables';

:root {
  --primary-color: #{$primary-color};
}

* {
  padding: 0;
  margin: 0;
  list-style: none;
  min-width: 0;
  min-height: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  outline: 0;
}

html, body {
  height: 100%;
  min-width: 1366px;
}

a {
  text-decoration: none;
}

hr {
  border: none;
  border-top: 1px solid #E8EAEC;
}

body {
  flex-direction: column;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, "Pingfang SC", "Segoe UI", "Helvetica Neue", Verdana, Arial, STHeiti, "Microsoft Yahei", sans-serif;
  color: #2c3e50;
  font-size: 13px;
  background-color: #eaeef4;
}

#app {
  height: 100%;
}

.fr {
  float: right;
}

.fl {
  float: left;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-wrap {
  word-break: break-all;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.text-line-clamp {
  @extend .text-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--line-clamp-value, 2);
  overflow: hidden;
}

@each $i in 1, 2, 3 {
  .text-line-clamp-#{$i} {
    @extend .text-line-clamp;
    --line-clamp-value: #{$i};
  }
}

.fc-primary {
  color: $primary-color !important;
}

.fc-red {
  color: #E06E7C !important;
}

.fc-blue {
  color: #4A90E2 !important;
}

.fc-green {
  color: #5CC20D !important;
}

.fc-black {
  color: black !important;
}

.fc-white {
  color: white !important;
}

.fc-gray {
  color: #ABABAB !important;
}

.fc-orange {
  color: orange !important;
}

@for $i from 12 through 30 {
  .fs-#{$i} {
    font-size: $i+px !important;
  }
}

@each $x in 6, 8, 10 {
  .fs-#{$x} {
    font-size: 12px !important;
    transform: scale($x/12);
    transform-origin: left center;
  }
}

@for $i from 0 through 20 {
  .width-#{$i*50} {
    width: $i*50+px !important;
  }
}

.width-full {
  width: 100% !important;
}

.height-full {
  height: 100% !important;
}

@for $i from 1 through 2 {
  $x: $i*5;

  .split-#{$x} > * {
    &:not(:last-child){
      margin-right: $x+px;
    }
  }
}

.ml-auto {
  margin-left: auto;
}

@each $x in 0, 1, 2, 3, 4, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 {
  .mt-#{$x} {
    margin-top: $x+px !important;
  }

  .mb-#{$x} {
    margin-bottom: $x+px !important;
  }

  .ml-#{$x} {
    margin-left: $x+px !important;
  }

  .mr-#{$x} {
    margin-right: $x+px !important;
  }

  .mtb-#{$x} {
    margin-top: $x+px !important;
    margin-bottom: $x+px !important;
  }

  .mlr-#{$x} {
    margin-left: $x+px !important;
    margin-right: $x+px !important;
  }

  .pt-#{$x} {
    padding-top: $x+px !important;
  }

  .pb-#{$x} {
    padding-bottom: $x+px !important;
  }

  .pl-#{$x} {
    padding-left: $x+px !important;
  }

  .pr-#{$x} {
    padding-right: $x+px !important;
  }

  .ptb-#{$x} {
    padding-top: $x+px !important;
    padding-bottom: $x+px !important;
  }

  .plr-#{$x} {
    padding-left: $x+px !important;
    padding-right: $x+px !important;
  }
}

.font-bold {
  font-weight: bold;
}

.flex {
  display: flex;
}

.flex-column {
  @extend .flex;
  flex-direction: column;
}

.flex-vcenter {
  @extend .flex;
  align-items: center;
}

.flex-center {
  @extend .flex-vcenter;
  justify-content: center;
}

.flex-between {
  @extend .flex;
  justify-content: space-between;
}

.flex-reverse {
  flex-flow: row-reverse;
}

.flex-wrap {
  @extend .flex;
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.pointer {
  cursor: pointer;
  outline: none;
}

.disabled {
  cursor: not-allowed !important;
  opacity: .5;
}

.helper {
  color: #7C7C7C;
}

.required-icon::after {
  content: '*';
  color: #F56C6C;
}

// 表格公共样式
.table-format-list {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #E7E7E7;
  line-height: initial;

  th, td {
    padding: 12px;
    min-width: 50px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  th {
    text-align: left;
    background: #f8f8f9;
  }

  td {
    max-width: 280px;
    border-top: 1px solid #E7E7E7;
  }

  tbody tr:hover {
    background-color: #F5F7FA;
  }
}

.font-mono {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;

  textarea {
    font-family: inherit !important;
  }
}

.main-content {
  margin: 10px 15px;
  padding: 15px;
  background: white;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.main-title, .main-title-primary {
  background: #F7F8FB;
  padding: 10px;
  color: #7C7C7C;
  margin-bottom: 15px;
  font-size: 12px;
}

.main-title-primary {
  border: 1px solid $primary-color;
}

.hidden, [hidden] {
  display: none !important;
}

.inline-block {
  display: inline-block;
}

.dropdown-item {
  &.selected {
    color: $primary-color;
    font-weight: bold;
  }

  &:not(.selected):focus {
    color: #606266;
    background: white;
  }
}

.vue-echarts {
  width: 100%;
  height: 100%;
}
